import React from 'react'
import { Button, Tag } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ProTable from '@ant-design/pro-table';
import Chunk from '../components/chunk'
import request from '@/utils/request'
export default () => {
    const dataList = [
        {
            title: "店铺结算金额（元）",
            value: "15617.24",
        },
        {
            title: "平台抽成（元）",
            value: "804.98",
        }
    ]


    const columns: any = [
        {
            title: '等级名称',
            dataIndex: 'title',
        },
        {
            title: '年费(元)',
            valueType: "money",
            render: (text: any) => <Tag color="cyan">{text} </Tag>,
            align: "center",
            dataIndex: 'annual_fee',
            hideInSearch: true,
        },
        {
            title: '创建时间',
            dataIndex: 'created_at',
            sorter: true,
            hideInSearch: true,
        },
        {
            title: '操作',
            align: "center",
            render: (text: any, record: any) => (
                <>
                    <Button size="small" type="primary" ghost style={{ marginRight: "6px" }} onClick={() => {
                        // setVisable(true)
                    }}>编辑</Button>
                    <Button size="small" danger>删除</Button>
                </>
            ),
        },
    ];

    return (
        <PageHeaderWrapper title={false}>
            <Chunk navTitle="结算概况" dataList={dataList} />
            <div style={{ height: "18px" }} />
            <ProTable<any>
                rowKey="id"
                columns={columns}
                request={(params: any) => request('/store/level-list', {
                    params,
                })}
                tableAlertRender={false}
                toolBarRender={(action, { selectedRows }) => [
                    <Button type="primary" onClick={() => {
                        // saveForm.resetFields()
                        // setVisable(true)
                    }}>
                        添加
                    </Button>
                ]}
            />
        </PageHeaderWrapper>
    )
}